{% extends "base.html" %}
{# Copyright The IETF Trust 2016, All Rights Reserved #}
{% load origin django_bootstrap5 static person_filters %}
{% block title %}Review request for {{ review_req.doc.name }}{% endblock %}
{% block pagehead %}
    <link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block content %}
    {% origin %}
    <h1>
        Review request
        <br>
        <small class="text-body-secondary">{{ review_req.doc.name }}</small>
    </h1>
    {% include "doc/review/request_info.html" %}
    {% if can_close_request %}
        <a class="btn btn-danger"
           href="{% url "ietf.doc.views_review.close_request" name=doc.name request_id=review_req.pk %}">
            <i class="bi bi-x-circle"></i>
            Close request
        </a>
    {% endif %}
    <h2 class="mt-5">History</h2>
    {% if can_add_comment %}
        <div class="buttonlist">
            <a class="btn btn-primary"
               href="{% url 'ietf.doc.views_review.add_request_comment' name=doc.name request_id=review_req.pk %}">
                <i class="bi bi-plus"></i>
                Add comment
            </a>
        </div>
    {% endif %}
    <div id="history">
        <table class="table table-sm table-striped tablesorter">
            <thead>
                <tr>
                    <th scope="col" data-sort="date">Date</th>
                    <th scope="col" data-sort="by">By</th>
                    <th scope="col" data-sort="description">Description</th>
                </tr>
            </thead>
	    <tbody>
            {% for h in history %}
                {% if h.history_change_reason %}
                    <tr>
                        <td>{{ h.history_date|date }}</td>
                        <td>{% person_link h.history_user.person %}</td>
                        <td>{{ h.history_change_reason }}</td>
                    </tr>
                {% endif %}
            {% endfor %}
	    </tbody>
        </table>
    </div>
{% endblock %}
{% block js %}
    <script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}